package com.smartjobs.action;

import java.util.ArrayList;
import java.util.Map;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.smartjobs.bean.EducationalQualificationBean;
import com.smartjobs.bean.JobseekerBean;
import com.smartjobs.bean.SkillMasterBean;
import com.smartjobs.bean.SkillsBean;
import com.smartjobs.bean.WorkExperienceBean;
import com.smartjobs.model.ViewJSProfileModel;

@SuppressWarnings("serial")
public class ViewJSProfileAction extends ActionSupport {

	JobseekerBean jobseeker;
	ArrayList<EducationalQualificationBean> educationalQualificationList;
	ArrayList<WorkExperienceBean> workExperienceList;
	ArrayList<SkillsBean> skillList;
	ArrayList<SkillMasterBean> skillMasterList;

	public ArrayList<SkillMasterBean> getSkillMasterList() {
		return skillMasterList;
	}

	public void setSkillMasterList(ArrayList<SkillMasterBean> skillMasterList) {
		this.skillMasterList = skillMasterList;
	}

	public ArrayList<SkillsBean> getSkillList() {
		return skillList;
	}

	public void setSkillList(ArrayList<SkillsBean> skillList) {
		this.skillList = skillList;
	}

	public ArrayList<WorkExperienceBean> getWorkExperienceList() {
		return workExperienceList;
	}

	public void setWorkExperienceList(
			ArrayList<WorkExperienceBean> workExperienceList) {
		this.workExperienceList = workExperienceList;
	}

	public ArrayList<EducationalQualificationBean> getEducationalQualificationList() {
		return educationalQualificationList;
	}

	public void setEducationalQualificationList(
			ArrayList<EducationalQualificationBean> educationalQualificationList) {
		this.educationalQualificationList = educationalQualificationList;
	}

	public JobseekerBean getJobseeker() {
		return jobseeker;
	}

	public void setJobseeker(JobseekerBean jobseeker) {
		this.jobseeker = jobseeker;
	}

	@SuppressWarnings("rawtypes")
	Map session = ActionContext.getContext().getSession();

	public String GetJSProfile() {
		jobseeker = new JobseekerBean();
		jobseeker.setJobSeekerID(Integer.parseInt(session.get("jobseekerID")
				.toString()));
		System.out
				.println("Inside GetJSProfile: " + jobseeker.getJobSeekerID());
		ViewJSProfileModel.GetJSProfile(jobseeker);
		return SUCCESS;
	}

	public String GetJSEQ() {
		educationalQualificationList = new ArrayList<EducationalQualificationBean>();
		int jobseekerID = (int) session.get("jobseekerID");
		ViewJSProfileModel.GetJSEQ(jobseekerID, educationalQualificationList);
		return SUCCESS;
	}

	public String GetJSWorkEx() {
		workExperienceList = new ArrayList<WorkExperienceBean>();
		int jobseekerID = (int) session.get("jobseekerID");
		ViewJSProfileModel.GetJSWorkEx(jobseekerID, workExperienceList);
		return SUCCESS;
	}

	public String GetJSSkills() {
		skillMasterList = new ArrayList<SkillMasterBean>();
		skillList = new ArrayList<SkillsBean>();
		int jobseekerID = (int) session.get("jobseekerID");
		ViewJSProfileModel.GetJSSkills(jobseekerID, skillList);
		ViewJSProfileModel.GetSkillMasterList(skillMasterList);
		return SUCCESS;
	}
}
